﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CQIE.TES.Model;

namespace CQIE.TES.IDAL
{
    public interface ICourseDAL
    {
        List<Course> GetCoursesInfo(int page, int limit, string search,out int count);

        List<Course> GetCoursesInfo(string search);

        bool Delete(int id);

        /// <summary>
        /// 获取课程教师
        /// </summary>
        /// <param name="courseID"></param>
        /// <returns>ID、Name、WorkNumber、IsFreeze</returns>
        List<Teacher> CourserTeachers(int courseID);

        /// <summary>
        /// 给课程添加或删除可以任教的老师
        /// </summary>
        /// <param name="courseId"></param>
        /// <param name="teacherIds"></param>
        /// <param name="type">0移除 1添加</param>
        void GiveOrRemoveCourseTeacher(int courseId, List<int> teacherIds,int type);

        /// <summary>
        /// 获取所有没被冻结的课程
        /// </summary>
        /// <returns></returns>
        List<Course> GetAllCourse();

        List<Course> GetClassCourse(int cid, int studyYearId);

        List<Course> GetClassCourse(int cid, int studyYearId, int pageNum, out int count, int limit);
        void InsertCourse(string name, string courseCode, bool isAlive);
        
        /// <summary>
        /// 获取班级没有的课程
        /// </summary>
        /// <param name="classId"></param>
        /// <param name="studyYear"></param>
        /// <returns></returns>
        List<Course> GetClassHaveNoCourse(int classId, int studyYear);
        
        /// <summary>
        /// 班级排课
        /// </summary>
        /// <param name="classId"></param>
        /// <param name="studyYear"></param>
        /// <param name="courseId"></param>
        /// <param name="teacherId"></param>
        /// <returns></returns>
        bool ClassAddCourse(int classId, int studyYear, int courseId, int teacherId);

        /// <summary>
        /// 获取教师所任课程
        /// </summary>
        /// <param name="teacherId"></param>
        /// <returns></returns>
        List<Teacher_Course> GetTeacherCourse(int teacherId);
    }
}
